home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 3 / ct-rom iiib.zip / ct-rom iiib / WINDOWS / DIVERSEN / WINE02BX / DIRED.2 < prev    next >
Text File  |  1993-03-28  |  49KB  |  1,279 lines

  1. Info file dired.info, produced by Makeinfo, -*- Text -*- from input
  2. file dired.texi.
  3.  
  4.    This file documents Tree Dired, the GNU Emacs Directory Browser, and
  5. most of the extra features available as an option.
  6.  
  7.    Copyright (C) 1991, 1992 Free Software Foundation
  8.  
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.  
  13.    Permission is granted to copy and distribute modified versions of
  14. this manual under the conditions for verbatim copying, provided also
  15. that the section entitled "GNU General Public License" is included
  16. exactly as in the original, and provided that the entire resulting
  17. derived work is distributed under the terms of a permission notice
  18. identical to this one.
  19.  
  20.    Permission is granted to copy and distribute translations of this
  21. manual into another language, under the above conditions for modified
  22. versions, except that the section entitled "GNU General Public
  23. License" may be included in a translation approved by the author
  24. instead of in the original English.
  25.  
  26. 
  27. File: dired.info,  Node: Dired User Options,  Next: Dired Configuration,  Prev: Dired Customization,  Up: Dired Customization
  28.  
  29. Customization of Dired
  30. ----------------------
  31.  
  32. The following variables are for personal customization in your
  33. `~/.emacs' file.  For example, include a line similar to the following
  34.  
  35.      (setq dired-listing-switches "-Alt")  ; sort on time, ignore . and ..
  36.  
  37.    to set your favorite Dired listing switches.
  38.  
  39. `dired-listing-switches'
  40.      Default: `"-al"'
  41.  
  42.      Switches passed to `ls' for Dired. Must contain the `l' option.
  43.  
  44. `dired-trivial-filenames'
  45.      Default: `"^\\.\\.?$\\|^#"'
  46.  
  47.      Regexp of files to skip when moving point to the first file of a
  48.      new directory listing.  Nil means move to the subdirectory line,
  49.      t means move to first file.
  50.  
  51. `dired-marker-char'
  52.      Default: `?*' (`?*' is the Lisp notation for the character `*'.)
  53.  
  54.      In Dired, character used to mark files for later commands.
  55.  
  56.      This is a variable so that one can write things like
  57.  
  58.           (let ((dired-marker-char ?X))
  59.              ;; great code using X markers ...
  60.              )
  61.  
  62. `dired-del-marker'
  63.      Default: `?D'
  64.  
  65.      Character used to flag files for deletion.
  66.  
  67.      Usually, marking for commands and flagging for deletion are
  68.      separate features.  (Internally they use the same marking
  69.      mechanism.)  You type `d' to flag with `D' and `x' to delete the
  70.      `D'-flagged files.
  71.  
  72.      This explains how to make deletion behave just like a special
  73.      case of the general file marking feature, so that you type `m' to
  74.      mark with `*' (as usual) and `d' to delete the `*' (or next N)
  75.      files: In your `~/.emacs', include
  76.  
  77.           (setq dired-del-marker dired-marker-char) ; use * also for deletions
  78.           (setq dired-load-hook
  79.                 (function
  80.                  (lambda ()
  81.                    ;; other customizations here
  82.                    ;; let "d" do the actual deletion:
  83.                    (define-key dired-mode-map "d" 'dired-do-delete))))
  84.  
  85.           If you do not like that `d' defaults to the current file if there
  86.      are no marks, replace the `define-key' statement in
  87.      `dired-load-hook' above with this one:
  88.  
  89.               (define-key dired-mode-map "d" 'dired-do-deletions)
  90.  
  91. `dired-shrink-to-fit'
  92.      Default: `(if (fboundp 'baud-rate) (> (baud-rate)
  93.      search-slow-speed) t)'
  94.  
  95.      Whether Dired shrinks the display buffer to fit the marked files.
  96.  
  97. `dired-no-confirm'
  98.      Default: `nil'
  99.  
  100.      If non-nil, list of commands Dired should not confirm. 
  101.      Confirmation for commands that require an argument to be entered
  102.      (like the shell command for `!') means a list of marked files is
  103.      displayed in a pop-up buffer.  Confirmation for commands that do
  104.      not require an argument (like compressing with `C') means you
  105.      have to confirm by typing `y' or `SPC'.
  106.  
  107.      Except `nil', it can be a sublist of
  108.  
  109.           '(byte-compile chgrp chmod chown compress copy delete hardlink load
  110.             move print shell symlink uncompress)
  111.  
  112.           to suppress confirmation for just those commands.
  113.  
  114. `dired-keep-marker-move'
  115.      Default: `t'
  116.  
  117.      If nil, moved files are not marked.
  118.  
  119.      If t, moved marked files are marked with the same marker they had
  120.      before (maybe none if you used the prefix argument to specify the
  121.      next N files).
  122.  
  123.      If a character, moved files (marked or not) are marked with that
  124.      character.
  125.  
  126.      This also applies to the following, similar variables for copied,
  127.      and hard or symbolically linked files:
  128.  
  129. `dired-keep-marker-copy'
  130.      Default: `?C'
  131.  
  132. `dired-keep-marker-hardlink'
  133.      Default: `?H'
  134.  
  135. `dired-keep-marker-symlink'
  136.      Default: `?Y'
  137.  
  138. `dired-dwim-target'
  139.      Default: `nil'
  140.  
  141.      If non-nil, Dired tries to guess a default target directory: If
  142.      there is a Dired buffer displayed in the next window, use its
  143.      current subdirectory, instead of the current subdirectory of this
  144.      Dired buffer.
  145.  
  146.      The target is used in the prompt for file copy, move etc., *Note
  147.      Copy and Move Into a Directory::.
  148.  
  149. `dired-copy-preserve-time'
  150.      Default: `nil'
  151.  
  152.      If non-nil, Dired preserves the last-modified time in a file copy. 
  153.      (This works on only some systems.)  Use `c' (`dired-do-copy')
  154.      with a zero prefix argument to toggle its value.  The prompt of
  155.      copy commands will display `Copy [-p]' instead of just `Copy' if
  156.      preservation of file times is turned on.
  157.  
  158. `dired-backup-if-overwrite'
  159.      Default: `nil'
  160.  
  161.      Non-nil if Dired should ask about making backups before
  162.      overwriting files.  Special value `'always' suppresses
  163.      confirmation.
  164.  
  165. 
  166. File: dired.info,  Node: Dired Configuration,  Next: Dired Hooks,  Prev: Dired User Options,  Up: Dired Customization
  167.  
  168. Dired Configuration
  169. -------------------
  170.  
  171.    The following variables should have already been installed
  172. correctly by your system manager.  If not, you can still set them in
  173. your `~/.emacs' file.
  174.  
  175. `dired-chown-program'
  176.      Pathname of chown command, default `"chown"' (or `"/etc/chown"'
  177.      on System V derived systems.)
  178.  
  179. `dired-ls-program'
  180.      Absolute or relative name of the `ls' program used by Dired,
  181.      default `"ls"'.
  182.  
  183. `dired-ls-F-marks-symlinks'
  184.      Set this to `t' if dired-ls-program with `-lF' marks the symbolic
  185.      link itself with a trailing `@' (usually the case under Ultrix).
  186.  
  187.      Example: If
  188.  
  189.           ln -s foo bar; ls -F bar
  190.  
  191.           gives
  192.  
  193.           bar -> foo
  194.  
  195.           set it to `nil', if it gives
  196.  
  197.           bar@ -> foo
  198.  
  199.           set it to `t'.
  200.  
  201.      Dired checks if there is really a @ appended.  Thus, if you have a
  202.      marking `ls' program on one host and a non-marking one on another
  203.      host, and do not care about symbolic links which really end in a
  204.      @, you can always set this variable to `t'.
  205.  
  206. 
  207. File: dired.info,  Node: Dired Hooks,  Prev: Dired Configuration,  Up: Dired Customization
  208.  
  209. Dired Hooks
  210. -----------
  211.  
  212. Hook variables can contain functions that are run at certain times in
  213. Dired.
  214.  
  215. `dired-load-hook'
  216.      Run after loading Dired.  You can customize key bindings or load
  217.      extensions with this.  For example:
  218.  
  219.           (setq dired-load-hook
  220.                 (function
  221.                  (lambda ()
  222.                   ;; Load extras:
  223.                   (load "dired-x")
  224.                   ;; How to define your own key bindings:
  225.                   (define-key dired-mode-map " " 'scroll-up)
  226.                   (define-key dired-mode-map "b" 'scroll-down))))
  227.  
  228. `dired-mode-hook'
  229.      Run at the very end of `dired-mode', after most buffer local
  230.      variables have been initialized (e.g., `default-directory' and
  231.      `dired-directory'), but before the directory listing has been read
  232.      in.
  233.  
  234.      Do buffer local things here, for example:
  235.  
  236.           (setq dired-mode-hook
  237.                 (function
  238.                  (lambda ()
  239.                    (dired-extra-startup)     ;; dired-extra support
  240.                    ;; How to set (local) variables in each new Dired buffer:
  241.                    (setq case-fold-search t)
  242.                    (setq truncate-lines t))))
  243.  
  244.           Since the listing has not yet been inserted you could still change
  245.      `dired-actual-switches'.  For example, if you use `ange-ftp.el',
  246.      you might want to replace the `-A' with the `-a' switch,
  247.      depending on whether `default-directory' corresponds to a System
  248.      V hosts that does not understand all BSD `ls' switches.  The
  249.      `dired.README' file gives an example.  If you set
  250.      `dired-actual-switches' remember that you may also have to set
  251.      `dired-sort-mode' to the appropriate string so that the modeline
  252.      looks right.
  253.  
  254.      Do not set `dired-mode-hook' inside your `dired-load-hook',
  255.      simply set it somewhere in your `~/.emacs' (before Dired is
  256.      loaded, if you explicitly load Dired).  This is so that
  257.      extensions packages loaded via the load hook can add things to
  258.      the `dired-mode-hook' at the front or at the end, as they see fit.
  259.  
  260.      In case you set `truncate-lines' to `t' as in the above example,
  261.      here is a function to toggle the value of `truncate-lines', in
  262.      Dired and other buffers:
  263.  
  264.           (defun set-truncate-lines ()
  265.             "Toggle value of truncate-lines and refresh window display."
  266.             (interactive)
  267.             (setq truncate-lines (not truncate-lines))
  268.             ;; now refresh window display (an idiom from simple.el):
  269.             (save-excursion
  270.               (set-window-start (selected-window)
  271.                                 (window-start (selected-window)))))
  272.  
  273.           You could bind it to `C-x 4 $':
  274.  
  275.           (define-key ctl-x-4-map "$" 'set-truncate-lines)
  276.  
  277.           It is sometimes useful to toggle `truncate-lines' in Dired buffers
  278.      to make long filenames completely visible and get the listing
  279.      properly aligned again.
  280.  
  281. `dired-before-readin-hook'
  282.      This hook is run before a dired buffer is newly read in (created
  283.      or reverted).
  284.  
  285. `dired-after-readin-hook'
  286.      After each listing of a file or directory, this hook is run with
  287.      the buffer narrowed to the listing.
  288.  
  289.      The `dired-subdir-alist' has already been updated so that the
  290.      usual Dired functions like `dired-get-filename' work.  It is
  291.      possible to modify the buffer with this hook.  The package
  292.      `dired-x.el' does this to implement omitting certain
  293.      uninteresting files from a Dired buffer.  Under X11, highlighting
  294.      of certain files is also possible (see package `dired-x11.el').
  295.  
  296. 
  297. File: dired.info,  Node: Tree Dired Extra,  Next: Dired Internals,  Prev: Dired,  Up: Top
  298.  
  299. Tree Dired Extra features
  300. *************************
  301.  
  302.    Numerous "extra" features are available, such as omitting certain
  303. files from listings, minibuffer history, RCS related commands, and
  304. more.
  305.  
  306. * Menu:
  307.  
  308. * Tree Dired Extra Features::
  309. * Dired Minibuffer History::
  310. * Inserting All Marked Subdirectories::
  311. * Dynamic Dired Markers::
  312. * Omitting Files in Dired::
  313. * Advanced Dired Mark Commands::
  314. * Virtual Dired::
  315. * Multiple Dired Directories::
  316. * Dired Local Variables::
  317. * Making Relative Symbolic Links in Dired::
  318. * Letting Dired Guess What Shell Command to Apply::
  319. * dired-trns.el::        Filename Transformers for Dired Shell Commands
  320. * dired-cd.el::            Changing the Working Directory for Dired Shell Commands
  321. * dired-nstd.el::        Nested Dired format
  322. * find-dired.el::        Feeding Find Output to Dired
  323.  
  324. 
  325. File: dired.info,  Node: Tree Dired Extra Features,  Next: Dired Minibuffer History,  Prev: Tree Dired Extra,  Up: Tree Dired Extra
  326.  
  327. Tree Dired Extra Features
  328. =========================
  329.  
  330.    The rest of this manual describes the extra features provided by the
  331. file `dired-x.el' and some other files.
  332.  
  333.    To take advantage of these features, you must load the file and set
  334. some variables and hooks.  See the accompanying `dired-x.README' file
  335. for details and a template of code to insert in your `.emacs'.
  336.  
  337.    Miscellanous features not fitting anywhere else:
  338.  
  339.    Variables:
  340.  
  341. `dired-find-subdir'
  342.      Default: `nil'
  343.  
  344.      If non-nil, Dired does not make a new buffer for a directory if it
  345.      can be found (perhaps as subdirectory) in some existing Dired
  346.      buffer.
  347.  
  348.      If there are several Dired buffers for a directory, the most
  349.      recently used is chosen.
  350.  
  351.      Dired avoids switching to the current buffer, so that if you have
  352.      a normal and a wildcard buffer for the same directory, `C-x d RET'
  353.      will toggle between those two.
  354.  
  355. `M-g'
  356.      (`dired-goto-file') Goto file line of a file (or directory).
  357.  
  358. `M-G'
  359.      (`dired-goto-subdir') Goto headerline of an inserted directory. 
  360.      This commands reads its argument with completion over the names
  361.      of the inserted subdirectories.
  362.  
  363. `&'
  364.      (`dired-do-background-shell-command') Run a shell command on the
  365.      marked files, in the background.  This requires `background.el'
  366.      from Olin Shiver's comint package to work.  Note that you can
  367.      type input to the command in its buffer.
  368.  
  369. `w'
  370.      (`dired-copy-filename-as-kill') The `w' command puts the names of
  371.      the marked (or next N) files into the kill ring, as if you had
  372.      killed them with `C-w'.  With a zero prefix argument N=0, use the
  373.      complete pathname of each file.  With a raw (just `C-u') prefix
  374.      argument, use the relative pathname of each marked file.  As a
  375.      special case, if no prefix argument is given and point is on a
  376.      directory headerline, it gives you the name of that directory,
  377.      without looking for marked files.
  378.  
  379.      The list of names is also stored onto the variable
  380.      `dired-marked-files' for use, e.g., in an `ESC ESC'
  381.      (`eval-expression') command.
  382.  
  383.      As this command also displays what was pushed onto the kill ring
  384.      you can use it to display the list of currently marked files in
  385.      the echo area (unless you happen to be on a subdirectory
  386.      headerline).
  387.  
  388.      You can then feed the file name to other Emacs commands with
  389.      `C-y'.  For example, say you want to rename a long filename to a
  390.      slightly different name.  First type `w' to push the old name
  391.      onto the kill ring.  Then type `r' to rename it and use `C-y'
  392.      inside `r''s minibuffer prompt to insert the old name at a
  393.      convenient place.
  394.  
  395. `T'
  396.      (`dired-do-toggle') Toggle marks.  That is, currently marked
  397.      files become unmarked and vice versa.  Files marked with other
  398.      flags (such as `D') are not affected.  The special directories
  399.      `.' and `..' are never toggled.
  400.  
  401. 
  402. File: dired.info,  Node: Dired Minibuffer History,  Next: Inserting All Marked Subdirectories,  Prev: Tree Dired Extra Features,  Up: Tree Dired Extra
  403.  
  404. Minibuffer History for Dired Shell Commands
  405. ===========================================
  406.  
  407.    If `dired-x.el' determines at load-time that the Gmhist package is
  408. available, the Dired shell commands `!' and `&' maintain a history of
  409. commands.  Use `M-p' and `M-n' to scroll through them while you are
  410. prompted in the minibuffer for a shell command.  *Note Gmhist Keys in
  411. the Minibuffer: (gmhist)Gmhist Keys in the Minibuffer, for more info.
  412.  
  413.    Gmhist also handles defaults:
  414.  
  415. `dired-dangerous-shell-command'
  416.      Default: `"rm"'
  417.  
  418.      Regexp for dangerous shell commands that should never be the
  419.      default.  It is deliberately chosen to match `rm' anywhere in the
  420.      command, e.g. in `rmdir'.
  421.  
  422. 
  423. File: dired.info,  Node: Inserting All Marked Subdirectories,  Next: Dynamic Dired Markers,  Prev: Dired Minibuffer History,  Up: Tree Dired Extra
  424.  
  425. Insert all marked subdirectories
  426. ================================
  427.  
  428. `I'
  429.      (`dired-do-insert-subdir') Insert all marked subdirectories that
  430.      are not already inserted.  Non-directories are silently ignored.
  431.  
  432.      Thus type `/I' to insert one more level of subdirectories.  You
  433.      can repeat this until no new directories are inserted to fully
  434.      expand the directory tree in this buffer.  As a faster
  435.      alternative, use the prefix argument for `C-x d' (`dired') to add
  436.      `R' to the switches.
  437.  
  438. 
  439. File: dired.info,  Node: Dynamic Dired Markers,  Next: Omitting Files in Dired,  Prev: Inserting All Marked Subdirectories,  Up: Tree Dired Extra
  440.  
  441. Dynamic Marker Characters
  442. =========================
  443.  
  444.    You can change the marker character from its usual value `*' to
  445. something else.  Use this to mark a different set of files while
  446. keeping the information on the already marked files.  You can nest
  447. several marker characters.  The current stack of marker characters is
  448. displayed in the Dired mode line, and all prompts of mark-using
  449. commands mention to which marker they apply.
  450.  
  451. `('
  452.      (`dired-set-marker-char') Set the marker character to something
  453.      else.  Use `)' to restore the previous value.
  454.  
  455. `)'
  456.      (`dired-restore-marker-char') Restore the marker character to its
  457.      previous value.  Uses `dired-default-marker' if the marker stack
  458.      is empty.
  459.  
  460.    Instead of using `m' inside a `('...`)', you can mark files "in
  461. passing" with, say `Z' without changing the current marker character. 
  462. You will probably later use `(' to temporarily make `Z' to the marker
  463. and do something on the `Z'-files, and then return using `)'.
  464.  
  465. `dired-mark-keys'
  466.      Default: `'("Z")'
  467.  
  468.      List of keys (strings) that insert themselves as file markers.
  469.  
  470. 
  471. File: dired.info,  Node: Omitting Files in Dired,  Next: Advanced Dired Mark Commands,  Prev: Dynamic Dired Markers,  Up: Tree Dired Extra
  472.  
  473. Omitting Files in Dired
  474. =======================
  475.  
  476.    "Omitting" a file means removing it from the directory listing. 
  477. Omitting is useful for keeping Dired buffers free of uninteresting
  478. files (for instance, auto-save, auxiliary, backup, and revision
  479. control files) so that the user can concentrate on the interesting
  480. files.  Like hidden files, omitted files are never seen by Dired. 
  481. *Note Hiding in Dired: (dired)Dired Hiding.  Omitting differs from
  482. hiding in several respects:
  483.  
  484.    * Omitting works on individual files, not on directories; an entire
  485.      directory cannot be omitted (though each of its files could be).
  486.  
  487.    * Omitting is wholesale; if omitting is turned on for a dired
  488.      buffer, then all "uninteresting" files listed in that buffer are
  489.      omitted.  The user does not omit (or unomit) files one at a time.
  490.  
  491.    * Omitting can be automatic; uninteresting file lines in the buffer
  492.      can be removed before the user ever sees them.
  493.  
  494.    * Marked files are never omitted.
  495.  
  496. `M-o'
  497.      (`dired-omit-toggle') Toggle between displaying and omitting
  498.      "uninteresting" files.  With a prefix argument, don't toggle and
  499.      just mark the files, but don't actually omit them.
  500.  
  501.    In order to make omitting work, you must have `dired-omit-expunge'
  502. on your `dired-after-readin-hook', and you must call
  503. `dired-omit-startup' (or `dired-extra-startup', which calls
  504. `dired-omit-startup') in your `dired-mode-hook'.  Simply loading
  505. `dired-x.el' inside `dired-load-hook' takes care of all this.
  506.  
  507.    The following variables can be used to customize omitting.
  508.  
  509. `dired-omit-files-p'
  510.      Default: `nil'
  511.  
  512.      If non-nil, "uninteresting" files are not listed.  Uninteresting
  513.      files are those whose filenames match regexp `dired-omit-files',
  514.      plus those ending with extensions in `dired-omit-extensions'. 
  515.      `M-o' (`dired-omit-toggle') toggles its value, which is
  516.      buffer-local.  Do
  517.  
  518.           (setq dired-omit-files-p t)
  519.  
  520.           inside your `dired-mode-hook' to have omitting initially turned on
  521.      in every Dired buffer.  Since `dired-x.el' prepends the form
  522.      `(dired-extra-startup)' to what you put yourself in your
  523.      `dired-mode-hook', the `setq' will take place after
  524.      `dired-omit-files-p' has already been made local to the current
  525.      Dired buffer, so modelines of non-dired buffers are not affected.
  526.       For this to work you shouldn't set `dired-mode-hook' inside
  527.      `dired-load-hook', but directly in your `~/.emacs' (before Dired
  528.      is loaded, if you explicitly load Dired).
  529.  
  530.      You can then use `M-o' to unomit in that buffer.
  531.  
  532. `dired-omit-files'
  533.      Default: `"^#\\|\\.$"'
  534.  
  535.      Filenames matching this buffer-local regexp will not be displayed. 
  536.      This only has effect when `dired-omit-files-p' is t.
  537.  
  538.      The default value omits the special directories `.' and `..' and
  539.      autosave files (plus other files ending in ".").
  540.  
  541. `dired-omit-extensions'
  542.      Default: The elements of `completion-ignored-extensions',
  543.      `latex-unclean-extensions', `bibtex-unclean-extensions' and
  544.      `texinfo-unclean-extensions'.
  545.  
  546.      If non-nil, a list of extensions (strings) to omit from Dired
  547.      listings.  Its format is the same as that of
  548.      `completion-ignored-extensions'.
  549.  
  550. `dired-omit-localp'
  551.      Default:  `'no-dir'
  552.  
  553.      The LOCALP argument `dired-omit-expunge' passes to
  554.      `dired-get-filename'.  If it is `'no-dir', omitting is much
  555.      faster, but you can only match against the non-directory part of
  556.      the filename.  Set it to `nil' if you need to match the whole
  557.      pathname or `t' to match the pathname relative to the buffer's
  558.      top-level directory.
  559.  
  560. `dired-omit-marker-char'
  561.      Default: `C-o'
  562.  
  563.      Temporary marker used by by Dired to implement omitting.  Should
  564.      never be used as marker by the user or other packages.  There is
  565.      one exception to this rule: by doing
  566.  
  567.           (setq dired-mark-keys "\C-o")
  568.           ;; i.e., the value of dired-omit-marker-char
  569.           ;; (which is not defined yet)
  570.  
  571.           anywhere in your `~/.emacs', you will bind the `C-o' key to
  572.      insert a C-o marker, thus causing these files to be omitted in
  573.      addition to the usually omitted files.  Unfortunately the files
  574.      you omitted manually this way will show up again after reverting
  575.      the buffer, unlike the others.
  576.  
  577.    To avoid seeing RCS files and the RCS directory, do
  578.  
  579.      (setq dired-omit-files "\\.$\\|#\\|^RCS$\\|,v$")
  580.  
  581.    This assumes `dired-omit-localp' has its default value of `'no-dir'
  582. to make the `^'-anchored matches work.  As a slower alternative, with
  583. `dired-omit-localp' set to `nil', you can use `/' instead of `^' in
  584. the regexp.
  585.  
  586.    If you use tib, the bibliography program for use with TeX and
  587. LaTeX, you might want to omit the `INDEX' and the `-t.tex' files:
  588.  
  589.      (setq dired-omit-files "\\.$\\|#\\|^INDEX$\\|-t\\.tex$")
  590.  
  591. 
  592. File: dired.info,  Node: Advanced Dired Mark Commands,  Next: Virtual Dired,  Prev: Omitting Files in Dired,  Up: Tree Dired Extra
  593.  
  594. Advanced Mark Commands
  595. ======================
  596.  
  597. `M-('
  598.      (`dired-mark-sexp') Mark files for which PREDICATE returns
  599.      non-nil.  With a prefix argument, unflag those files instead.
  600.  
  601.      The PREDICATE is a lisp expression that can refer to the following
  602.      symbols:
  603.  
  604.     `inode'
  605.           [integer] the inode of the file (only for `ls -i' output)
  606.  
  607.     `s'
  608.           [integer] the size of the file for `ls -s' output (usually
  609.           in blocks or, with `-k', in KBytes)
  610.  
  611.     `mode'
  612.           [string]  file permission bits, e.g., `"-rw-r--r--"'
  613.  
  614.     `nlink'
  615.           [integer] number of links to file
  616.  
  617.     `uid'
  618.           [string]  owner
  619.  
  620.     `gid'
  621.           [string]  group  (If the gid is not displayed by `ls', this
  622.           will still be set (to the same as uid))
  623.  
  624.     `size'
  625.           [integer] file size in bytes
  626.  
  627.     `time'
  628.           [string]  the time that `ls' displays, e.g., `"Feb 12 14:17"'
  629.  
  630.     `name'
  631.           [string]  the name of the file
  632.  
  633.     `sym'
  634.           [string]  if file is a symbolic link, the linked-to name,
  635.           else `""'
  636.  
  637.           For example, use
  638.  
  639.           (equal 0 size)
  640.  
  641.           to mark all zero length files.
  642.  
  643.      To find out all not yet compiled Emacs lisp files in a directory,
  644.      dired all `.el' files in the lisp directory using the wildcard
  645.      `*.el'.  Then use `M-(' with
  646.  
  647.           (not (file-exists-p (concat name "c")))
  648.  
  649.           to mark all `.el' files without a corresponding `.elc' file.
  650.  
  651. `M-M'
  652.      (`dired-do-unmark') Unmark marked files by replacing the marker
  653.      with another character.  The new character defaults to a space,
  654.      effectively unmarking them.
  655.  
  656. `,'
  657.      (`dired-mark-rcs-files') Mark all files that are under RCS
  658.      control.  With prefix argument, unflag all those files.  Mentions
  659.      RCS files for which a working file was not found in this buffer. 
  660.      Type `W' (`dired-why') to see them again.
  661.  
  662. `C-m C-c'
  663.      (`C-m C-c' is the suggested binding for
  664.      `dired-mark-files-compilation-buffer', it is not bound by
  665.      default.) Mark the files mentioned in the `*compilation*' buffer.
  666.       With an argument, you may specify the other buffer and your own
  667.      regexp instead of `compilation-error-regexp'.  Use `^.+$' (the
  668.      default with a prefix argument) to match complete lines.  In
  669.      conjunction with narrowing the other buffer you can mark an
  670.      arbitrary list of files, one per line, with this command.  If
  671.      your regexp contains a subexpression, i.e.  `\(...\)', that
  672.      subexpression is taken for the file name, else the whole match is
  673.      used.  Thus you can easily strip pre- and suffixes from filenames
  674.      by using `PREFIX\(.+\)POSTFIX' as regexp.
  675.  
  676.      This is especially useful for a list of files obtained from `M-x
  677.      grep' or output from a similar shell command.
  678.  
  679. `C-m C-d'
  680.      (`C-m C-d' is the suggested binding for
  681.      `dired-mark-files-from-other-dired-buffer', it is not bound by
  682.      default.) Mark those files in this Dired buffer that have the
  683.      same name as the marked files in the Dired buffer in the other
  684.      window.
  685.  
  686.      In short, mark the corresponding files from the other Dired
  687.      buffer.
  688.  
  689. `F'
  690.      (`dired-do-find-file') Visit all marked files at once, and
  691.      display them simultaneously.  If you want to keep the dired buffer
  692.      displayed, type `C-x 2' first.  If you want just the marked files
  693.      displayed and nothing else, type `C-x 1' first.
  694.  
  695.      The current window is split across all files.  Remaining lines go
  696.      to the last window.
  697.  
  698.      The number of files that can be displayed this way is restricted
  699.      by the height of the current window and the variable
  700.      `window-min-height'.
  701.  
  702. `dired-mark-extension'
  703.      Mark all files with a certain extension for use in later commands. 
  704.      A `.' is not automatically prepended to the string entered.
  705.  
  706.      When called from lisp, EXTENSION may also be a list of extensions
  707.      and an optional argument MARKER-CHAR specifies the marker used.
  708.  
  709. `dired-flag-extension'
  710.      Flag all files with a certain extension for deletion.  A `.' is
  711.      *not* automatically prepended to the string entered.
  712.  
  713. `dired-clean-patch'
  714.      Flag dispensable files created by the `patch' program for
  715.      deletion.  See variable `patch-unclean-extensions'.
  716.  
  717. `dired-clean-tex'
  718.      Flag dispensable files created by TeX, LaTeX and `texinfo' for
  719.      deletion.  See variables `tex-unclean-extensions',
  720.      `texinfo-unclean-extensions', `latex-unclean-extensions' and
  721.      `bibtex-unclean-extensions'.
  722.  
  723.    Variables used by the above cleanup commands (and in the default
  724. value for variable `dired-omit-extensions'):
  725.  
  726. `patch-unclean-extensions'
  727.      Default:  `'(".rej" ".orig")'
  728.  
  729.      List of extensions of dispensable files created by the `patch'
  730.      program.
  731.  
  732. `tex-unclean-extensions'
  733.      Default:  `'(".toc" ".log" ".aux")'
  734.  
  735.      List of extensions of dispensable files created by TeX.
  736.  
  737. `texinfo-unclean-extensions'
  738.      Default: `'(".cp" ".cps" ".fn" ".fns" ".ky" ".kys" ".pg" ".pgs"
  739.      ".tp" ".tps" ".vr" ".vrs")'
  740.  
  741.      List of extensions of dispensable files created by texinfo.
  742.  
  743. `latex-unclean-extensions'
  744.      Default: `'(".idx" ".lof" ".lot" ".glo")'
  745.  
  746.      List of extensions of dispensable files created by LaTeX.
  747.  
  748. `bibtex-unclean-extensions'
  749.      Default:  `'(".blg" ".bbl")'
  750.  
  751.      List of extensions of dispensable files created by BibTeX.
  752.  
  753. 
  754. File: dired.info,  Node: Virtual Dired,  Next: Multiple Dired Directories,  Prev: Advanced Dired Mark Commands,  Up: Tree Dired Extra
  755.  
  756. Virtual Dired
  757. =============
  758.  
  759.    Using "Virtual Dired" means putting a buffer with Dired-like
  760. contents in Dired mode.  The files described by the buffer contents
  761. need not actually exist.  This is useful if you want to peruse an `ls
  762. -lR' output file, for example one you got from an FTP server.  You can
  763. use all motion commands usually available in Tree Dired.  You can also
  764. use it to save a Dired buffer in a file and resume it in a later
  765. session.
  766.  
  767.    Type `M-x dired-virtual' to put the current buffer into virtual
  768. Dired mode.  You will be prompted for the top level directory of this
  769. buffer, with a default value guessed from the buffer contents.  To
  770. convert the virtual to a real Dired buffer again, type `g' (which
  771. calls `dired-virtual-revert') in the virtual Dired buffer and answer
  772. `y'.  You don't have to do this, though: you can relist single
  773. subdirectories using `l' (`dired-do-redisplay') on the subdirectory
  774. headerline, leaving the buffer in virtual Dired mode all the time.
  775.  
  776.    The function `dired-virtual-mode' is specially designed to turn on
  777. virtual Dired mode from the `auto-mode-alist'.  To automatically edit
  778. all `*.dired' files in virtual Dired mode, put this into your
  779. `~/.emacs':
  780.  
  781.      (setq auto-mode-alist (cons '("[^/]\\.dired$" . dired-virtual-mode)
  782.                                    auto-mode-alist))
  783.  
  784.    The regexp is a bit more complicated than usual to exclude ".dired"
  785. local variable files.
  786.  
  787. 
  788. File: dired.info,  Node: Multiple Dired Directories,  Next: Dired Local Variables,  Prev: Virtual Dired,  Up: Tree Dired Extra
  789.  
  790. Multiple Dired Directories and Non-Dired Commands
  791. =================================================
  792.  
  793.    An Emacs buffer can have but one working directory, stored in the
  794. buffer-local variable `default-directory'.  A Dired buffer may have
  795. several subdirectories inserted, but still has but one working
  796. directory: that of the top level Dired directory in that buffer.  For
  797. some commands it is appropriate that they use the current Dired
  798. directory instead of `default-directory', e.g., `find-file' and
  799. `compile'.
  800.  
  801.    A general mechanism is provided for special handling of the working
  802. directory in special major modes:
  803.  
  804. `default-directory-alist'
  805.      Default: `((dired-mode . (dired-current-directory)))'
  806.  
  807.      Alist of major modes and their opinion on `default-directory', as
  808.      a lisp expression to evaluate.  A resulting value of `nil' is
  809.      ignored in favor of `default-directory'.
  810.  
  811. `default-directory'
  812.      Function with usage like variable `default-directory', but knows
  813.      about the special cases in variable `default-directory-alist'.
  814.  
  815.    The following dired-x commands take special care about the current
  816. Dired directory:
  817.  
  818. `find-this-file'
  819.      Bind this to `C-x C-f' as a replacement for `find-file' that will
  820.      prompt for the filename within the current Dired subdirectory, not
  821.      the top level directory.
  822.  
  823. `find-this-file-other-window'
  824.      Bind this to `C-x 4 C-f' as a replacement for
  825.      `find-file-other-window'.
  826.  
  827. `dired-smart-shell-command'
  828.      Like function `shell-command', but in the current Tree Dired
  829.      directory.  Bound to `M-!' in Dired buffers.
  830.  
  831. `dired-smart-background-shell-command'
  832.      Like function `background', but in the current Tree Dired
  833.      directory.  Bound to `M-&' in Dired buffers.
  834.  
  835. `dired-jump-back'
  836.      (Suggested binding `C-x j') Jump back to dired: If in a file,
  837.      dired the current directory and move to file's line.  If in Dired
  838.      already, pop up a level and goto old directory's line.  In case
  839.      the proper Dired file line cannot be found, refresh the Dired
  840.      buffer and try again.
  841.  
  842. `dired-jump-back-other-window'
  843.      (Suggested binding `C-x 4 j') Like `dired-jump-back', but to
  844.      other window.
  845.  
  846. `dired-vm'
  847.      (`V') Run VM on this file (assumed to be a UNIX mail folder). 
  848.      Further `v' commands from within VM in that folder will default
  849.      to the folder's directory, not the usual `vm-folder-directory'.
  850.  
  851.      If you give this command a prefix argument, it will visit the
  852.      folder read-only.  This only works in VM 5, not VM 4.
  853.  
  854.      If the variable `dired-vm-read-only-folders' is t, `dired-vm'
  855.      will visit all folders read-only.  If it is neither `nil' nor
  856.      `t', e.g., the symbol `'if-file-read-only', only files not
  857.      writable by you are visited read-only.  This is the recommended
  858.      value if you run VM 5.
  859.  
  860. `dired-rmail'
  861.      Run Rmail on this file (assumed to be mail folder in Rmail/BABYL
  862.      format).
  863.  
  864. 
  865. File: dired.info,  Node: Dired Local Variables,  Next: Making Relative Symbolic Links in Dired,  Prev: Multiple Dired Directories,  Up: Tree Dired Extra
  866.  
  867. Local Variables for Dired Directories
  868. =====================================
  869.  
  870.    When Dired visits a directory, it looks for a file whose name is the
  871. value of variable `dired-local-variables-file' (default: `.dired'). 
  872. If such a file is found, Dired will temporarily insert it into the
  873. Dired buffer and run `hack-local-variables'.  *Note Local Variables in
  874. Files: (emacs)File Variables.  You can set
  875. `dired-local-variables-file' to `nil' to suppress this.
  876.  
  877.    For example, put
  878.  
  879.      Local Variables:
  880.      dired-actual-switches: "-lat"
  881.      dired-sort-mode: " by date"
  882.      End:
  883.  
  884.    into a `.dired' file of a directory to sort by date only in that
  885. directory.  Note that since `dired-hack-local-variables' is run inside
  886. `dired-mode-hook' the modeline has already been set, so you have to
  887. update that for yourself by setting `dired-sort-mode' in addition to
  888. changing the switches.
  889.  
  890. 
  891. File: dired.info,  Node: Making Relative Symbolic Links in Dired,  Next: Letting Dired Guess What Shell Command to Apply,  Prev: Dired Local Variables,  Up: Tree Dired Extra
  892.  
  893. Making Relative Symbolic Links in Dired
  894. =======================================
  895.  
  896.    In GNU Emacs version 18, the built-in function `make-symbolic-link'
  897. always calls `expand-file-name' on its arguments, so relative symlinks
  898. (e.g.  `foo -> ../bar/foo') are impossible to create.
  899.  
  900.    Dired Extra uses `call-process' and `ln -s' for a workaround.
  901.  
  902. `dired-make-symbolic-link'
  903.      Arguments NAME1 NAME2 and optional OK-IF-ALREADY-EXISTS.  Create
  904.      file NAME2, a symbolic link pointing to NAME1 (which may be any
  905.      string whatsoever and is passed untouched to `ln -s'). 
  906.      OK-IF-ALREADY-EXISTS means that NAME2 will be overwritten if it
  907.      already exists.  If it is an integer, user will be asked about
  908.      this.  On error, signals a file-error.
  909.  
  910. `dired-make-relative-symlink'
  911.      Three arguments: FILE1 FILE2 and optional OK-IF-ALREADY-EXISTS. 
  912.      Make a symbolic link FILE2 (pointing to FILE1).  The link is
  913.      relative (if possible), for example
  914.  
  915.           (dired-make-relative-symlink "/vol/tex/bin/foo"
  916.                                        "/vol/local/bin/foo")
  917.  
  918.           results in a link
  919.  
  920.           /vol/local/bin/foo -> ../../tex/bin/foo
  921.  
  922. `dired-do-relsymlink'
  923.      (binding `S') Symbolically link all marked (or next N) files into
  924.      a directory, or make a symbolic link to the current file.  This
  925.      creates relative symbolic links like
  926.  
  927.               foo -> ../bar/foo
  928.  
  929.           not absolute ones like
  930.  
  931.               foo -> /ugly/path/that/may/change/any/day/bar/foo
  932.  
  933. `dired-do-relsymlink-regexp'
  934.      (`%S') Symbolically link all marked files containing REGEXP to
  935.      NEWNAME, using relative (not absolute) names.  See functions
  936.      `dired-rename-regexp' and `dired-do-relsymlink' for more info.
  937.  
  938. 
  939. File: dired.info,  Node: Letting Dired Guess What Shell Command to Apply,  Next: dired-trns.el,  Prev: Making Relative Symbolic Links in Dired,  Up: Tree Dired Extra
  940.  
  941. Letting Dired Guess What Shell Command to Apply
  942. ===============================================
  943.  
  944.    Based upon the name of a filename, Dired tries to guess what shell
  945. command you might want to apply to it.  For example, if you have point
  946. on a file named `foo.tar' and you press `!', Dired will guess you want
  947. to `tar xvf' it and suggest that as the default shell command.
  948.  
  949.    If you are using the `gmhist' package (*Note Dired Minibuffer
  950. History::), the default will be mentioned in brackets and you can type
  951. `M-p' to get the default into the minibuffer so that you can edit it,
  952. e.g., changing `tar xvf' to `tar tvf'.  If there are several commands
  953. for a given file, e.g., `xtex' and `dvips' for a `.dvi' file, you can
  954. type `M-p' several times to see each of the matching commands.
  955.  
  956.    Dired only tries to guess a command for a single file, never for a
  957. list of marked files.
  958.  
  959. `dired-auto-shell-command-alist-default'
  960.      Predefined rules for shell commands.  Set this to nil to turn
  961.      guessing off.  The elements of `dired-auto-shell-command-alist'
  962.      (defined by the user) will override these rules.
  963.  
  964. `dired-auto-shell-command-alist'
  965.      If non-nil, an alist of file regexps and their suggested commands
  966.      overriding the predefined rules in
  967.      `dired-auto-shell-command-alist-default'.
  968.  
  969.      Each element of the alist looks like
  970.  
  971.           (REGEXP COMMAND...)
  972.  
  973.           where each COMMAND can either be a string or a lisp expression
  974.      that evaluates to a string.  If several COMMANDs are given, all
  975.      will temporarily be pushed on the history.
  976.  
  977.      These rules take precedence over the predefined rules in the
  978.      variable `dired-auto-shell-command-alist-default' (to which they
  979.      are prepended when `dired-x' is loaded).
  980.  
  981.      You can set this variable in your `~/.emacs'.  For example, to
  982.      add rules for `.foo' and `.bar' file extensions, write
  983.  
  984.           (setq dired-auto-shell-command-alist
  985.                 (list
  986.                  (list "\\.foo$" "FOO-COMMAND");; fixed rule
  987.                  ;; possibly more rules...
  988.                  (list "\\.bar$";; rule with condition test
  989.                         '(if CONDITION
  990.                              "BAR-COMMAND-1"
  991.                            "BAR-COMMAND-2"))))
  992.  
  993.           This will override any predefined rules for the same extensions.
  994.  
  995. `dired-guess-have-gnutar'
  996.      Default: `nil'
  997.  
  998.      If non-nil, name of the GNU tar executable (e.g., `"tar"' or
  999.      `"gnutar"').  GNU tar's `z' switch is used for compressed tar
  1000.      files.  If you don't have GNU tar, set this to nil: a pipe using
  1001.      `zcat' is then used.
  1002.  
  1003. 
  1004. File: dired.info,  Node: dired-trns.el,  Next: dired-cd.el,  Prev: Letting Dired Guess What Shell Command to Apply,  Up: Tree Dired Extra
  1005.  
  1006. Filename Transformers for Dired Shell Commands
  1007. ==============================================
  1008.  
  1009.    File name "transformers" are functions that take a filename (a
  1010. string) as an argument and transform it into some other string (e.g.,
  1011. a filename without an extension).  This package makes transformers
  1012. available in Dired shell commands.
  1013.  
  1014.    For example, running the Dired shell command (type `!' or `M-x'
  1015. `dired-do-shell-command')
  1016.  
  1017.      echo * [b] [db]
  1018.  
  1019.    would list the full name, the basename, and the absolute basename of
  1020. each marked file.
  1021.  
  1022.    Each transformer is associated with a dispatch character. The
  1023. associations are stored in a keymap for fast and easy lookup. The
  1024. dispatch character is used to activate the associated transformer
  1025. function at a particular position in a shell command issued in Dired. 
  1026. The dispatch character must be enclosed in brackets to distinguish it
  1027. from normal letters.
  1028.  
  1029.    To take advantage of this package, simply load it after loading
  1030. Dired, e.g., in your `dired-load-hook'.  You can then use transformers
  1031. like "[b]" for the basename in your Dired shell commands (see below).
  1032.  
  1033.    You can define your own transformers using the macro
  1034. `dired-trans-define'.
  1035.  
  1036. `dired-trans-define'
  1037.      Macro that assigns the transformer function `(lambda (file)
  1038.      BODY)' to CHAR (a character or string).  BODY must return a
  1039.      string: the transformed file.
  1040.  
  1041.    Several transformers are predefined:
  1042.  
  1043. `*'
  1044.      returns the unmodified filename (equivalent to `[dbe]').
  1045.  
  1046. `n'
  1047.      returns the Name component of a filename without directory
  1048.      information
  1049.  
  1050. `d'
  1051.      returns the Directory component of a filename
  1052.  
  1053. `b'
  1054.      returns the Basename of a filename, i.e., the name of the file
  1055.      without directory and extension (see variable
  1056.      `dired-trans-re-ext') A basename with directory component can be
  1057.      obtained by `[db]'.
  1058.  
  1059. `e'
  1060.      returns the Extension of a filename (i.e., whatever
  1061.      `dired-trans-re-ext' splits off)
  1062.  
  1063. `v'
  1064.      returns a file without directory and without `,v' suffixes if any.
  1065.  
  1066. `z'
  1067.      returns a file without directory and without `.Z' suffixes if any.
  1068.  
  1069. The following variables can be used to customize `dired-trns.el':
  1070.  
  1071. `dired-trans-re-ext'
  1072.      Default: `"\\.[^.]*\\(\\.Z\\)?$"'
  1073.  
  1074.      The part of a filename matching this regexp will be viewed as
  1075.      extension.
  1076.  
  1077. `dired-trans-starters'
  1078.      Default: `"[#[]"'
  1079.  
  1080.      User definable set of characters to be used to indicate the start
  1081.      of a transformer sequence.
  1082.  
  1083. `dired-trans-enders'
  1084.      Default: `"[]# ]"'
  1085.  
  1086.      User definable set of characters to be used to indicate the end
  1087.      of a transformer sequence.
  1088.  
  1089. 
  1090. File: dired.info,  Node: dired-cd.el,  Next: dired-nstd.el,  Prev: dired-trns.el,  Up: Tree Dired Extra
  1091.  
  1092. Changing the Working Directory for Dired Shell Commands
  1093. =======================================================
  1094.  
  1095.    The package `dired-cd.el' permits the working directory of the
  1096. Dired shell commands `!' (`dired-do-shell-command') and `&'
  1097. (`dired-do-background-shell-command') to be the files' subdirectory
  1098. under certain circumstances.  Loading this extension does not change
  1099. the behavior of Dired until the variables `dired-cd-same-subdir' and/or
  1100. `dired-cd-on-each' are non-nil.
  1101.  
  1102.    If `dired-cd-same-subdir' is non-nil and if all the selected files
  1103. (marked, non-zero numeric argument, etc.) are in the same subdirectory,
  1104. then `dired-do-shell-command' and `dired-do-background-shell-command'
  1105. cause the shell to perform a `cd' into that directory before the
  1106. commands are executed.  Also, the selected filenames are provided to
  1107. the command without any directory components.
  1108.  
  1109.    If `dired-cd-on-each' is non-nil and if the `on-each' option is
  1110. specified (numeric argument of zero), then `!'
  1111. (`dired-do-shell-command') and `&'
  1112. (`dired-mark-background-shell-command') use a subshell to perform a
  1113. `cd' into the subdirectory of each file before the commands on that
  1114. file are executed.  Also, each filename is provided to the command
  1115. without any directory components.  Note that this behavior occurs
  1116. regardless of whether the files are all in the same directory or not.
  1117.  
  1118.    After the above `cd' wrapping has occured, the existing
  1119. `dired-shell-stuff-it' is used to do the actual file-name quoting and
  1120. substitution into the command.  Thus, custom versions of this
  1121. procedure should work, e.g., the `dired-trans' package will transform
  1122. commands correctly.  However, since filenames lack any directory
  1123. components, features that use the directory components will fail, e.g. 
  1124. the `[d]' transform specifier will be empty.
  1125.  
  1126.    To use this package, load it in your `dired-load-hook'.  Do
  1127.  
  1128.      (setq dired-cd-same-subdir t)
  1129.  
  1130. and perhaps
  1131.  
  1132.      (setq dired-cd-on-each t)
  1133.  
  1134. in your `~/.emacs'.  By default, `dired-cd' doesn't change the
  1135. behavior of Dired when it is loaded.
  1136.  
  1137.    If `dired-cd-same-subdir' is non-nil, then the shell commands `cd'
  1138. to the appropriate directory if all the selected files are in that
  1139. directory; however, on-each behavior (with zero prefix argument) is
  1140. not changed.
  1141.  
  1142.    If `dired-cd-on-each' is non-nil, then each instance of the command
  1143. for an on-each shell command runs in the file's directory regardless of
  1144. whether the files are all in the same directory.
  1145.  
  1146. 
  1147. File: dired.info,  Node: dired-nstd.el,  Next: find-dired.el,  Prev: dired-cd.el,  Up: Tree Dired Extra
  1148.  
  1149. Nested Dired format
  1150. ===================
  1151.  
  1152.    [NO DOCUMENTATION YET]
  1153.  
  1154.    This is still buggy, *Note Dired Known Problems::.
  1155.  
  1156. 
  1157. File: dired.info,  Node: find-dired.el,  Prev: dired-nstd.el,  Up: Tree Dired Extra
  1158.  
  1159. Feeding Find Output to Dired
  1160. ============================
  1161.  
  1162.    The `find-dired' command runs the `find' command in a buffer and
  1163. starts Dired on the inserted file lines, even while `find' is still
  1164. running.  For example, with `-type d' as argument, you will get a
  1165. Dired buffer that contains all subdirectories of a given directory,
  1166. but none of the other files.
  1167.  
  1168.    Note that `find' just gives you file lines, not inserted
  1169. subdirectories with associated headerlines as repeated use of the `i'
  1170. (`dired-maybe-insert-subdir') command would.  Also, the names contain
  1171. slashes if they are in a subdirectory, which never occurs in a normal
  1172. Dired buffer.  Dired understands these names anyway and you can for
  1173. example type `f' on such lines as usual.  However, while `find' is
  1174. still running you shouldn't type `i' to insert subdirectories, since
  1175. new `find' output is always appended at the end.  Use `f' or `o'
  1176. instead to dired the specific subdirectory in a new Dired buffer. 
  1177. After `find' has finished (as indicated by a message and the modeline)
  1178. all Dired commands work as usual.
  1179.  
  1180. `find-dired'
  1181.      Run `find' on a directory DIR, with find arguments ARGS, and go
  1182.      into dired-mode on a buffer of the output.  The command run
  1183.      (after changing into DIR) is
  1184.  
  1185.           find . \( ARGS \) -ls
  1186.  
  1187. `find-name-dired'
  1188.      Search DIR recursively for files matching the globbing pattern
  1189.      PATTERN, and run Dired on those files.  PATTERN is a shell
  1190.      wildcard (not an Emacs regexp) and need not be quoted.  The
  1191.      command run (after changing into DIR) is
  1192.  
  1193.               find . -name 'PATTERN' -ls
  1194.  
  1195. `find-grep-dired'
  1196.      Find files in directory DIR containing a regexp ARG and start
  1197.      Dired on output.  The command run (after changing into DIR) is
  1198.  
  1199.           find . -exec grep -s ARG {} \; -ls
  1200.  
  1201. 
  1202. File: dired.info,  Node: Dired Internals,  Next: Dired Known Problems,  Prev: Tree Dired Extra,  Up: Top
  1203.  
  1204. Dired Internals
  1205. ***************
  1206.  
  1207.    This is a short introduction about how Dired's Tree and Mark
  1208. features work.  You are encouraged to read the code (`dired.el') for
  1209. more information.
  1210.  
  1211. * Menu:
  1212.  
  1213. * Tree Dired Internals::
  1214. * Dired Mark Internals::
  1215.  
  1216. 
  1217. File: dired.info,  Node: Tree Dired Internals,  Next: Dired Mark Internals,  Prev: Dired Internals,  Up: Dired Internals
  1218.  
  1219. Tree Dired Internals
  1220. ====================
  1221.  
  1222.    In Tree Dired, instead of just one directory, all or part of the
  1223. directory *tree* starting at the top level directory (the working
  1224. directory or `default-directory' of the buffer) may be in a Dired
  1225. buffer.  Each file line belongs to exactly one of those
  1226. subdirectories.  After the `ls' program has inserted its output, Dired
  1227. parses the buffer once to find out where the subdirectory boundaries
  1228. are and saves them in the variable `dired-subdir-alist'.  The
  1229. beginning of the headerline inserted by `ls' serves as boundary
  1230. between subdirectories.
  1231.  
  1232.    Subsequent `i' (`dired-maybe-insert-subdir') commands update this
  1233. alist and insert the appropriate headerline.  Each retrieval of the
  1234. filename on the current line first extracts the basename (assuming a
  1235. more or less standard `ls' output format), and then function
  1236. `dired-current-directory' looks up the current Dired directory in
  1237. `dired-subdir-alist'.  The lookup is keyed on buffer position, as each
  1238. buffer position is between exactly two subdirectory boundaries.  (The
  1239. end of the buffer serves as an implicit subdirectory boundary.)
  1240.  
  1241. `dired-subdir-alist'
  1242.      Association list of subdirectories and their buffer positions:
  1243.  
  1244.           ((LASTDIR . LASTMARKER) ... (DEFAULT-DIRECTORY . FIRSTMARKER)).
  1245.  
  1246.           The markers point right before the beginning of the line, so that
  1247.      they separate subdirectories adjacent in the buffer.  The
  1248.      directories must be in the form returned by
  1249.      `file-name-as-directory'.
  1250.  
  1251. `dired-subdir-regexp'
  1252.      Value: "^. \\([^ \n\r]+\\)\\(:\\)[\n\r]"
  1253.  
  1254.      Regexp matching a maybe hidden subdirectory line in `ls -lR'
  1255.      output.  Subexpression 1 is subdirectory proper, no trailing
  1256.      colon.  The match starts at the beginning of the line and ends
  1257.      after the end of the line (`\n' or `\r').  Subexpression 2 must
  1258.      end right before the `\n' or `\r'.  This is so that Dired can
  1259.      easily check whether a subdirectory is hidden or not: hidden
  1260.      lines end with `\r' (`C-m') instead of a newline.
  1261.  
  1262.      This regexp used to be `"^. \\(/[^\n\r]*\\)\\(:\\)[\n\r]"',
  1263.      allowing spaces, but disallowing relative filenames (which occur
  1264.      when browsing ls -lR listing in virtual Dired mode, so I changed
  1265.      it).
  1266.  
  1267.      Note that `"^. \\([^\n\r]+\\)\\(:\\)[\n\r]"' (desirable since it
  1268.      allows both spaces and relative names) will not always work: if
  1269.      you have a file that ends in a colon, its whole line (including
  1270.      permission bits, date etc.) would be mistaken for a subdirectory
  1271.      headerline when parsing `ls -lR' output.
  1272.  
  1273.      `dired-subdir-regexp' is only relevant for parsing `ls -lR'
  1274.      output.  If Dired inserts subdirectories itself (using
  1275.      `dired-insert-subdir'), they will always be absolute and there is
  1276.      no restriction on the format of filenames, e.g., they can contain
  1277.      spaces.
  1278.  
  1279.